package com.huawei.hms.push.a;

import android.util.SparseArray;
import com.huawei.hms.common.ApiException;
import com.huawei.hms.push.SendException;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.api.entity.auth.AuthCode;
import com.huawei.hms.support.api.entity.auth.AuthCode.StatusCode;
import com.huawei.hms.support.api.entity.core.CommonCode.ErrorCode;

public enum a {
    SUCCESS(0, 0, "success"),
    ERROR_NO_TOKEN(800000000, SendException.ERROR_NO_TOKEN, "token missing"),
    ERROR_NO_TOKENSIGN(800000001, SendException.ERROR_TOKEN_INVALID, "token invalid"),
    ERROR_NO_NETWORK(800000002, SendException.ERROR_NO_NETWORK, "no network"),
    ERROR_SERVICE_NOT_AVAILABLE(800000003, SendException.ERROR_SERVICE_NOT_AVAILABLE, "service not available"),
    ERROR_PUSH_SERVER(800000004, SendException.ERROR_PUSH_SERVER, "push server error"),
    ERROR_UNKNOWN(800000005, SendException.ERROR_UNKNOWN, "unknown error"),
    ERROR_TOKEN_DECRYPT(800200001, SendException.ERROR_TOKEN_INVALID, "token invalid"),
    ERROR_TOKENSIGN_VALID(800200002, SendException.ERROR_TOKEN_INVALID, "token invalid"),
    ERROR_TOPIC_EXCEED(800200003, 907122034, "topic exceed"),
    ERROR_TOPIC_SEND(800200004, 907122035, "topic send error"),
    ERROR_SIZE(800300000, SendException.ERROR_SIZE, "message size error"),
    ERROR_INVALID_PARAMETERS(800300001, SendException.ERROR_INVALID_PARAMETERS, "parameter invalid"),
    ERROR_TOO_MANY_MESSAGES(800300002, SendException.ERROR_TOO_MANY_MESSAGES, "too many messages"),
    ERROR_TTL_EXCEEDED(800300003, SendException.ERROR_TTL_EXCEEDED, "ttl exceed"),
    ERROR_PUSH_ARGUMENTS_INVALID(807135000, ErrorCode.ARGUMENTS_INVALID, "arguments invalid"),
    ERROR_PUSH_INTERNAL_ERROR(807135001, ErrorCode.INTERNAL_ERROR, "internal error"),
    ERROR_PUSH_NAMING_INVALID(807135002, ErrorCode.NAMING_INVALID, "naming invalid"),
    ERROR_PUSH_CLIENT_API_INVALID(807135003, ErrorCode.CLIENT_API_INVALID, "client api invalid"),
    ERROR_PUSH_EXECUTE_TIMEOUT(807135004, ErrorCode.EXECUTE_TIMEOUT, "execute timeout"),
    ERROR_PUSH_NOT_IN_SERVICE(807135005, ErrorCode.NOT_IN_SERVICE, "not int service"),
    ERROR_SPUSH_ESSION_INVALID(807135006, ErrorCode.SESSION_INVALID, "session invalid"),
    ERROR_ARGUMENTS_INVALID(ErrorCode.ARGUMENTS_INVALID, ErrorCode.ARGUMENTS_INVALID, "arguments invalid"),
    ERROR_INTERNAL_ERROR(ErrorCode.INTERNAL_ERROR, ErrorCode.INTERNAL_ERROR, "internal error"),
    ERROR_NAMING_INVALID(ErrorCode.NAMING_INVALID, ErrorCode.NAMING_INVALID, "naming invalid"),
    ERROR_CLIENT_API_INVALID(ErrorCode.CLIENT_API_INVALID, ErrorCode.CLIENT_API_INVALID, "client api invalid"),
    ERROR_EXECUTE_TIMEOUT(ErrorCode.EXECUTE_TIMEOUT, ErrorCode.EXECUTE_TIMEOUT, "execute timeout"),
    ERROR_NOT_IN_SERVICE(ErrorCode.NOT_IN_SERVICE, ErrorCode.NOT_IN_SERVICE, "not int service"),
    ERROR_SESSION_INVALID(ErrorCode.SESSION_INVALID, ErrorCode.SESSION_INVALID, "session invalid"),
    ERROR_API_NOT_SPECIFIED(1002, 1002, "API not specified"),
    ERROR_GET_SCOPE_ERROR(AuthCode.ErrorCode.GET_SCOPE_ERROR, AuthCode.ErrorCode.GET_SCOPE_ERROR, "get scope error"),
    ERROR_SCOPE_LIST_EMPTY(AuthCode.ErrorCode.SCOPE_LIST_EMPTY, AuthCode.ErrorCode.SCOPE_LIST_EMPTY, "scope list empty"),
    ERROR_CERT_FINGERPRINT_EMPTY(AuthCode.ErrorCode.CERT_FINGERPRINT_EMPTY, AuthCode.ErrorCode.CERT_FINGERPRINT_EMPTY, "certificate fingerprint empty"),
    ERROR_PERMISSION_LIST_EMPTY(AuthCode.ErrorCode.PERMISSION_LIST_EMPTY, AuthCode.ErrorCode.PERMISSION_LIST_EMPTY, "permission list empty"),
    ERROR_AUTH_INFO_NOT_EXIST(StatusCode.AUTH_INFO_NOT_EXIST, StatusCode.AUTH_INFO_NOT_EXIST, "auth info not exist"),
    ERROR_CERT_FINGERPRINT_ERROR(StatusCode.CERT_FINGERPRINT_ERROR, StatusCode.CERT_FINGERPRINT_ERROR, "certificate fingerprint error"),
    ERROR_PERMISSION_NOT_EXIST(StatusCode.PERMISSION_NOT_EXIST, StatusCode.PERMISSION_NOT_EXIST, "permission not exist"),
    ERROR_PERMISSION_NOT_AUTHORIZED(StatusCode.PERMISSION_NOT_AUTHORIZED, StatusCode.PERMISSION_NOT_AUTHORIZED, "permission not authorized"),
    ERROR_PERMISSION_EXPIRED(StatusCode.PERMISSION_EXPIRED, StatusCode.PERMISSION_EXPIRED, "permission expired"),
    ERROR_HMS_CLIENT_API(907122048, 907122048, "HMS client api invalid"),
    ERROR_OPERATION_NOT_SUPPORTED(907122049, 907122049, "operation not supported");
    
    private static final SparseArray<a> P = null;
    private int Q;
    private int R;
    private String S;

    static {
        P = new SparseArray();
        a[] values = values();
        int length = values.length;
        int i;
        while (i < length) {
            a aVar = values[i];
            P.put(aVar.Q, aVar);
            i++;
        }
    }

    private a(int i, int i2, String str) {
        this.Q = i;
        this.R = i2;
        this.S = str;
    }

    public int a() {
        return this.Q;
    }

    public int b() {
        return this.R;
    }

    public String c() {
        return this.S;
    }

    public static a a(int i) {
        return (a) P.get(i, ERROR_UNKNOWN);
    }

    public static ApiException a(a aVar) {
        return new ApiException(new Status(aVar.b(), aVar.c()));
    }
}
